<template>
    <div class="about">
        <h2>我是about组件</h2>
        <div class="aboutnav">
            <button @click="clickhome">首页</button>
            <button @click="clickuser">user</button>
        </div>
        <div class="back">
            <button @click="clickback">返回</button>
        </div>
    </div>
</template>
<script setup>
import { useRouter } from "vue-router"
const router = useRouter()
function clickhome() {
    router.push("/home")
}
function clickuser() {
    router.push({
        path: "/user/03",
        query: {
            name: "小染",
            age: 19
        }
    })
}
// router前进后退
function clickback() {
    // 1.后退
    router.back()
    // 2.前进
    //router.forward()
    // 3.控制层级
    // router.go(+1)
}
</script>
<style scoped lang="less"></style>